<%@ page language="java" import="java.util.*,com.tjyx.maintain.dto.ProductClass" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>产品类别发布</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript" src="${webRootPath }/maintain/js/productClass.js"></script>
		<script type="text/javascript" src="${webRootPath }/common/js/maintain.js"></script>
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	</head>

	<body>
		<!-- 产品类别发布 -->
		<div id="buildUpNewsClass" align="center">
			<font color="red"><c:out value="${addMessage}"></c:out></font>
			<form action="maintain_ProductClassAction_addProductClass_post.do"
				method="post">
				<table width="80%" align="center" border="1  solid red"
					align="center" cellpadding="1" cellspacing="0">
					<tr bgcolor="#95CACA">
						<td align="center" colspan="2" height="25">
							<strong>添加产品类别</strong>
						</td>
					</tr>
					<tr>
						<td width="20%" height="23" align="center">
							所属类别：
						</td>
						<td width="30%" height="23">
							<select id="parentClass" name="parentClass"
								style="width: 140px; height: 24px">
								<option selected="selected" value="0">
									根目录
								</option>
								<c:forEach items="${allproductClass}" var="singleclass">
									<option value="${singleclass.productClassId}">
										${singleclass.productClassName}
									</option>
								</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td width="20%" height="23" align="center">
							产品类名：
						</td>
						<td>
							<input type="text" name="prodcutClassName">
						</td>
					</tr>
					<tr>
						<td width="20%" height="23" align="center">
							显示序号：
						</td>
						<td>
							<input type="text" name="sortnumber">
						</td>
					</tr>
					<tr>
						<td align=center colspan="2" height="25">
							<input type="submit" name="添加" value="添加">
							<input type="reset" name="取消" value="取消">
						</td>
					</tr>
				</table>
			</form>
		</div>

     <br>
		<!-- 产品类别管理 -->
		 <div id="operateMessage" align="center"></div>
		<table width="80%" align="center" border="1  solid red"
			align="center" cellpadding="1" cellspacing="0">
			<tr bgcolor="#95CACA">
				<td align="center" height="25"  colspan="3" >
					<strong>管理产品类别</strong>
				</td>
			</tr>
			<tr bgcolor="#95CACA">
				<td width="40%" align="center">
					产品类名
				</td>
				<td width="10%" align="center">
					排序
				</td>
				<td width="30%" align="center">
					操作
				</td>
			</tr>
			
			<c:forEach items="${firstDir}" var="proClass">
				<tr  id="${proClass.productClassId}" bgcolor="#FFDAC8" >
					<td align="left" id="${proClass.productClassId+500000}" onclick="updateProductValue(${proClass.productClassId+500000},'${proClass.productClassName}')">
						<img src='common/images/plus.gif'>${proClass.productClassName}
					</td>
					<td align="center" id="${proClass.productClassId+200000}" onclick="updateSortValue(${proClass.productClassId+200000})">
						${proClass.sortNumber}
					</td>
					<td align="center">
						<a href="javascript:Delete(${proClass.productClassId},${proClass.productClassId})">删除</a>
					</td>
				</tr>
			
				<c:forEach items="${hashMapChilden}" var="proClass1">
				    <c:if test="${proClass1.key==proClass.productClassId}" var="dd">
				      <c:forEach items="${proClass1.value}" var="pro">
				       <tr id="${pro.productClassId}">
					<td align="left"  id="${pro.productClassId+500000}" onclick="updateProductValue1(${pro.productClassId+500000},'${pro.productClassName}')">
						&nbsp;&nbsp;&nbsp;&nbsp;<img src='common/images/nofollow.gif'>${pro.productClassName}
					</td>
					<td align="center"  id="${pro.productClassId+100000}"  onclick="updateSortValue1(${pro.productClassId+100000})">
						${pro.sortNumber}
					</td>
					<td align="center">
						<a href="javascript:Delete(${pro.productClassId},${pro.productClassId})">删除</a>
					</td>
				</tr>
				      </c:forEach>
				    </c:if>
				
				</c:forEach>
			</c:forEach>
		</table>

	</body>
</html>
